//
//  FJCustomKeyboardView.m
//  OnionHome
//
//  Created by fengjie on 2019/10/21.
//  Copyright © 2019 FengJie. All rights reserved.
//

#import "FJCustomKeyboardView.h"
#import "FJNumberKeyboard.h"

@interface FJCustomKeyboardView ()

/**
 数字键盘
 */
@property (nonatomic,strong)FJNumberKeyboard *numberKeyBoard;


@end

@implementation FJCustomKeyboardView

#pragma mark - init

- (instancetype)init
{
    self = [super init];
    if (self) {
        
        self.frame = CGRectMake(0, 0, kEMScreenWidth, kEMCustomKeyboardHeight);
        [self addSubview:self.numberKeyBoard];
    }
    return self;
}
-(void)setCompleteTitle:(NSString *)completeTitle{
    _completeTitle = completeTitle;
    self.numberKeyBoard.completeTitle = completeTitle;
}

- (FJNumberKeyboard *)numberKeyBoard
{
    if (!_numberKeyBoard) {
        _numberKeyBoard = [[FJNumberKeyboard alloc] initWithFrame:self.bounds];
        kWeakSelf(weakSelf);
        _numberKeyBoard.backBlock = ^{
            BlockSafeRun(weakSelf.backBlock);
        };
        _numberKeyBoard.completeTitle = self.completeTitle;
    }
    return _numberKeyBoard;
}
@end
